<template>
	<view class="pop-content">
		<view class="list-view">
			<view class="item-box" @click="gotoAddFridge">
				<iconfont :name="'diy'" :size="30" :color="'#c4c4c4'"></iconfont>
				<text style="padding-left: 20rpx;">自主创建</text>
			</view>
			<!-- 		<view class="item-box" @click="scan">
				<uni-icons type="scan" color="#c4c4c4" size="30"></uni-icons>
				<text style="padding-left: 20rpx;">扫码加入</text>
			</view> -->
		</view>
	</view>
</template>

<script>
	export default {
		name: "my-add-fridge-pop",
		data() {
			return {

			};
		},
		methods: {
			// 跳转
			gotoAddFridge() {
				uni.navigateTo({
					url: '/pagesSub/pageFridge/select_brand/select_brand'
				})
				this.close()
			},
			// 事件处理
			scan() {
				// 允许从相机和相册扫码
				uni.scanCode({
					scanType: ['qrCode'],
					success: (res) => {
						console.log('条码内容：' + res.result);
					}
				});
				this.close()
			},
			close() {
				this.$emit('close')
			}
		}
	}
</script>

<style lang="scss">
	.pop-content {
		display: flex;
		flex-direction: column;
		background-color: #fff;
		border-radius: 20rpx 20rpx 0 0;
		align-items: center;
		padding-bottom: 30px;

		.list-view {
			display: flex;
			flex-direction: column;
			width: 100%;
			align-items: center;

			.item-box {
				display: flex;
				width: 90%;
				font-size: 40rpx;
				padding: 20rpx 0;
				border-bottom: 1px solid #d8d8d8;
				align-items: center;
				justify-content: center;
			}
		}
	}
</style>